Component({
  data: {
    title: "用户隐私保护提示",
    desc1: "感谢您使用本平台，您使用本平台前应当阅井同意",
    urlTitle: "《用户隐私保护指引》",
    desc2:
      "当您点击同意并开始时用产品服务时，即表示你已理解并同息该条款内容，该条款将对您产生法律约束力。如您拒绝，将无法进入使用。",
    innerShow: !1,
    height: 0,
  },
  lifetimes: {
    attached: function () {
      var t = this;
      wx.getPrivacySetting
        ? wx.getPrivacySetting({
            success: function (e) {
              console.log(
                "是否需要授权：",
                e.needAuthorization,
                "隐私协议的名称为：",
                e.privacyContractName
              ),
                e.needAuthorization ? t.popUp() : t.triggerEvent("agree");
            },
            fail: function () {},
            complete: function () {},
          })
        : this.triggerEvent("agree");
    },
  },
  methods: {
    handleDisagree: function (t) {
      this.triggerEvent("disagree"), this.disPopUp();
    },
    handleAgree: function (t) {
      this.triggerEvent("agree"), this.disPopUp();
    },
    popUp: function () {
      this.setData({ innerShow: !0 });
    },
    disPopUp: function () {
      this.setData({ innerShow: !1 });
    },
    openPrivacyContract: function () {
      wx.openPrivacyContract({
        success: function (t) {
          console.log("openPrivacyContract success");
        },
        fail: function (t) {
          console.error("openPrivacyContract fail", t);
        },
      });
    },
  },
});
